package lianxi;

public class demo1 {
    public static void main(String[] args) {
        System.out.println(detectCapitalUse("sas"));
    }

    public static boolean detectCapitalUse(String word) {
        char[] words = word.toCharArray();
        int daxie = 0;
        int xiaoxie = 0;
        for (int i = 0; i < words.length; i++) {
            if (words[i] >= 'a') {
                xiaoxie++;
            } else {
                daxie++;
            }
        }
        if (daxie == words.length) {
            return true;
        }
        if (xiaoxie ==words.length) {
            return true;
        }
        return daxie == 1 && words[0] < 'a';
    }


}
